package com.gw.vip.server.service.dao_service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gw.vip.server.dao.TmpOrderMapper;
import com.gw.vip.server.po.TmpOrder;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @author GW
 * @description
 * @since 2022-05-07
 */
@Service
public class TmpOrderService extends ServiceImpl<TmpOrderMapper, TmpOrder> {

    public void truncate() {
        this.baseMapper.truncate();
    }

    public Integer initData(LocalDate clearDate) {
        return this.baseMapper.initData(clearDate);
    }

    public void initDataFromHis(LocalDate clearDate) {
        this.baseMapper.initDataFromHis(clearDate);
    }

    public BigDecimal orderSum(LocalDate clearDate) {
        BigDecimal sumAmt = this.baseMapper.orderSum(clearDate);
        if (sumAmt==null){
            return BigDecimal.ZERO;
        }
        return sumAmt;
    }

    public List<TmpOrder> listByClearDate(LocalDate clearDate) {
        return this.baseMapper.listByClearDate(clearDate);
    }
}
